Skip to content

Support interface implementing another interface - #473

Merged
hlship merged 2 commits into
masterfrom
hls/20260601-interface-implements
Jun 1, 2026
Merged

Support interface implementing another interface#473
hlship merged 2 commits into
masterfrom
hls/20260601-interface-implements

Conversation

@hlship

@hlship hlship commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds support for the GraphQL spec (Oct 2021) feature where interfaces may implement other interfaces
  • SDL parser and EDN schema both accept implements on interface definitions
  • Objects implementing a sub-interface transitively satisfy all parent interfaces (:members and type compatibility)
  • Validation errors for: missing fields, implementing a non-interface type, self-reference, and circular chains (A→B→C→A)
  • Introspection returns implemented interfaces for interface types

🤖 Generated with eca

hlship and others added 2 commits June 1, 2026 15:57
Per GraphQL spec (October 2021), interfaces may now implement other
interfaces.

- Update ANTLR grammar: interfaceDef accepts optional implementationDef
- Regenerate GraphqlSchemaParser.java
- Update SDL parser xform for interfaceDef to capture implements
- Update ::interface spec to allow optional ::implements
- compile-type :interface validates implemented types exist and are interfaces
- prepare-and-validate-interfaces: expands object :implements transitively,
  validates sub-interface declares all parent fields, expands :members to
  include objects that implement via sub-interfaces
- add check-compatible [:interface :interface] for covariant field types
- introspection resolve-interfaces returns implemented interfaces for
  interface types (nil when none, consistent with prior object behavior)

🤖 Generated with [eca](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
- interface implementing itself is caught in compile-type :interface
- indirect cycles (A->B->C->A) caught in prepare-and-validate-interfaces
  by checking if an interface appears in its own transitive implements set

🤖 Generated with [eca](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
@hlship hlship self-assigned this Jun 1, 2026
@hlship hlship added this to the 1.3.0 milestone Jun 1, 2026
@hlship
hlship merged commit 1510262 into master Jun 1, 2026
8 of 9 checks passed
@hlship hlship changed the title Support interface implementing another interface (closes #464) Support interface implementing another interface Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant